//
//  AppDelegate.m
//  彩票
//
//  Created by mac on 15-3-24.
//  Copyright (c) 2015年 mac. All rights reserved.
//

#import "AppDelegate.h"
#import "YXTabBarController.h"
#import "YXViewController.h"

@interface AppDelegate ()

@end

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // 1.创建UIWindow
    self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
//    // 2.加载UIStoryboard
//   // UIStoryboard *board = [UIStoryboard storyboardWithName:@"YXHallStoryboard" bundle:nil];
//    // 3.获取初始化控制器
//    //UINavigationController *nav = board.instantiateInitialViewController;
//    // 4.拿到栈顶控制器
//    //UIViewController *vc = nav.topViewController;
//      YXTabBarController *vc = [[YXTabBarController alloc] init];
//    // 4.加载新特性
//    // 4.1获取当前版本号并对比之前保存版本号
//    NSString *currentNum = [NSBundle mainBundle].infoDictionary[@"CFBundleShortVersionString"];
//    // NSLog(@"currentNum==%@",currentNum);
//    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
//    NSString *previousNum = [defaults valueForKey:@"sandboxVersion"];
//    if ([currentNum compare:previousNum] == NSOrderedDescending) {
//        // 显示新特性并保存版本号
//        YXViewController *newFeature = [[YXViewController alloc] init];
//        self.window.rootViewController = newFeature;
//        [defaults setValue:currentNum forKey:@"sandboxVersion"];
//        // 注册监听
//        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(chooseTabbarVc) name:@"chooseRootController" object:nil];
//        
//    }else{
//        
//      
//        // 5.设置WINDOW的根控制器
//        self.window.rootViewController = vc;
//    }
    // 6.设置window可见
    [self.window makeKeyAndVisible];
    [self.window chooseRootViewController];
    return YES;
}




@end
